<?php

if (!defined('APP_ROOT')) define('APP_ROOT', dirname(__FILE__) . '/../../');
if (!defined('APP_INC')) define('APP_INC', APP_ROOT . '/../../inc/');
if (!defined('APP_LIB')) define('APP_LIB', APP_ROOT . '/../../lib/');

require_once(APP_ROOT . '/inc/config.php');

require_once(APP_ROOT . '/lib/finance/In.class.php');

class CdrTest extends PHPUnit_Framework_TestCase {
  
	public function setUp() {
	}
	
	public function tearDown() { 
		
	}
	
	public function testa() {
		
		require_once(APP_ROOT . '/lib/finance/InItem.class.php');
		
		$aa = new InItem();
	
		$db = newdb('fy');
		$fmt = "SELECT * FROM %s WHERE status < 3 ORDER BY id DESC";
		$sql = sprintf($fmt, Constant::tbl_cw_in);
		$result = $db->query($sql);
		
		while ($row = $db->fetch_array($result)) {
			$aa->_update_finish_x($row[id]);
		}
		
		$ret = true;
	
		$this->assertTrue($ret);
	}
}
?>